<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hello World (Simplest Usage) / Gio.js</title>

    <!-- JQuery is not necessary, it is used for AJAX in this demo -->

    <script src="js/jquery.min.js"></script>

    <!-- must include Three.js library before Gio.js-->

    <script src="js/three.min.js"></script>

    <!-- must include the Gio.js library-->

    <script src="../build/gio.min.js"></script>

    <link rel="stylesheet" href="css/common.css">

    <style>

        #globalArea {

            height: 100%;
            width: 100%;
            margin: 0;
            padding: 0;

        }

    </style>

</head>
<body>

<header>A demo showing the simplest usage of Gio.js</header>

<div id="globalArea"></div>

<div class="view_source">
    <a href="https://github.com/syt123450/Gio.js/blob/master/examples/00_hello_world(simplest).html">View Source</a>
</div>

<script>

    // get the container to hold the IO globe

    var container = document.getElementById( "globalArea" );

    // create controller for the IO globe, input the container as the parameter

    var controller = new GIO.Controller( container );

    // ask a file for the JSON data, using AJAX to load the data

    $.ajax( {

        url: "data/sampleData.json",
        type: "GET",
        contentType: "application/json; charset=utf-8",
        async: true,
        dataType: "json",
        success: function ( inputData ) {

            // if received the data, use addData() API to add the the data to the controller

            controller.addData( inputData );

            // call the init() API to show the IO globe in the browser

            controller.init();

        }

    } );

</script>

</body>
</html>